﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace GGSharp.Radio.XML
{
    public class Channel
    {
        private string _description;
        private int _name;

        private List<ChannelServer> _servers = new List<ChannelServer>();

        public Channel(XmlReader reader)
        {
            _description = reader.GetAttribute("description");
            Int32.TryParse(reader.GetAttribute("chname"), out _name);

            while (reader.Read() && reader.NodeType != XmlNodeType.EndElement)
                Servers.Add(new ChannelServer(reader));
        }

        public string Description
        {
            get { return _description; }
            protected set { _description = value; }
        }

        public int Name
        {
            get { return _name; }
            protected set { _name = value; }
        }

        public List<ChannelServer> Servers
        {
            get { return _servers; }
            protected set { _servers = value; }
        }
    }
}
